home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / graphics.txt < prev    next >
Text File  |  1993-07-18  |  56KB  |  1,636 lines

  1. Info file graphics.info, produced by Makeinfo, -*- Text -*- from
  2. input file graphics.texi.
  3.  
  4.    This file documents GNU graphics.
  5.  
  6.    Copyright (C) 1989 Free Software Foundation, Inc.
  7.  
  8. 
  9. File: graphics.info,  Node: Top,  Up: (dir)
  10.  
  11. * Menu:
  12.  
  13. * introduction::         About the GNU graphics utilities
  14. * graph examples::       Using Graph to create plot files from data
  15. * graph invocation::     Command line options for Graph.
  16. * plot2ps examples::     converting plot files to PostScript
  17. * plot2ps invocation::   Plot2ps Command Line Options
  18. * xplot::                a plot file previewer for X11
  19. * xplot invocation::     xplot command line options and X11 resources
  20. * plot2fig examples::    converting plot files to Fig graphics editor format
  21. * plot2fig invocation::  command line options for plot2fig
  22. * plot2tek invocation::  Tektronix 4010 output
  23. * latex example::        Including a Figure in an Article
  24. * psfig::                Options to `psfig' for Including Figures
  25. * atend.pl::             A perl script for use with psfig
  26. * dvips::                How to Get `dvips'
  27. * idraw::                How to Get `idraw'
  28. * ghostscript::          an X11 PostScript interpreter/previewer
  29. * libps::                The Library of Plot Functions for PostScript Output
  30. * files::                The Plot File Format
  31. * Acknowledgements::     The Contributors
  32. * Function Index::       An Index to the libps Functions
  33.  
  34. 
  35. File: graphics.info,  Node: introduction,  Next: graph examples,  Up: Top
  36.  
  37. The GNU Graphics Utilities
  38. **************************
  39.  
  40.    The GNU graphics utilities are a set of programs for plotting
  41. scientific data.  The program `graph' reads data files and writes a
  42. stream of plotting commands in a device independent format refered
  43. to below as a GNU plot file.  The remaining programs provide support
  44. for displaying GNU plot files on tektronix 4010, PostScript (TM)*,
  45. and X window system compatible output devices.
  46.  
  47.    `graph' reads both ascii and binary data files and writes a plot
  48. file with or without axes and labels.  You can specify labels and
  49. ranges for the axes, and you can set the sizes and position of the
  50. plot on the page.  Each invocation of graph produces a plot with
  51. single set of axes and data.  You can place an arbitrary number of
  52. plots on the page by concatenating the plot output of several
  53. invocations.
  54.  
  55.    `plot2ps' is a utility for converting plot files into PostScript. 
  56. The `plot2ps' utility reads plotting commands from named files or
  57. the standard input and writes PostScript to the standard output. 
  58. You can then print the PostScript output on a printer, or edit it
  59. using the `idraw' graphics editor.  You can also easily include the
  60. output in LaTeX documents using `dvips' and the LaTeX command `psfig'.
  61.  
  62.    Why is this useful? The plot file format is a common standard on
  63. un*x systems.  To produces figures for publication, you might need
  64. to take data sets, and produce labeled figures from them.  This can
  65. be done using `graph', `plot2ps' and the `idraw' editor.  You can
  66. also include these figures in LaTeX documents using the `dvips'
  67. utility.  All of these utilities, as well as the plot file format
  68. and plot library, are discussed in the following sections.
  69.  
  70.    This documentation is under revision.  Any comments, suggestions,
  71. or additions would greatly benifit GNU users.  Please mail them to
  72. either `bug-gnu-utils@prep.ai.mit.edu' or `Rich@Rice.edu'.
  73.  
  74.    * PostScript is a trademark of Adobe Systems Incorporated.
  75.  
  76. 
  77. File: graphics.info,  Node: graph examples,  Next: graph invocation,  Prev: introduction,  Up: Top
  78.  
  79. `graph' Examples
  80. ================
  81.  
  82.    Each invocation of `graph' plots data read from stdin or named
  83. files togeather in a single plot with or without axes and labels. 
  84. The following sections show common usage of `graph'.
  85.  
  86. * Menu:
  87.  
  88. * Invocation::        Simple examples using graph
  89. * Input Files::        What the input looks like
  90. * Overlaying::        Combining several data sets in one plot
  91. * Multiple Plots::    Multiple plots on one page
  92. * Binary Data::        Reading other data formats
  93.  
  94. 
  95. File: graphics.info,  Node: Invocation,  Next: Input Files,  Up: graph examples
  96.  
  97. Simple examples using graph
  98. ===========================
  99.  
  100.    By default, `graph' reads ascii data from the standard input or
  101. files specified on the command line.  `graph' reads pairs of values,
  102. x and y coordinates:
  103.  
  104.      0.0  0.0
  105.      1.0  0.2
  106.      2.0  0.0
  107.      3.0  0.4
  108.      4.0  0.2
  109.      5.0  0.6
  110.  
  111.    To plot this data, you might use
  112.  
  113.      graph < ascii_data_file |plot
  114.  
  115.    where ascii_data_file could contain data similar to the above
  116. example.  You can replace the command `plot' with `plot2tek' if you
  117. have
  118. a tektronix 4010 compatible graphics terminal, `plot2ps' if you have
  119. a postscript compatible printer or previewer, or `xplot' if you have
  120. an X window system display.
  121.  
  122.    Note that `graph' is commonly supplied with some operating systems.
  123. If so, some confusion may arise if the system supplied version is
  124. executed mistakenly.  On unix systems, you can determine which
  125. version you invoke by typing the command `which graph', which prints
  126. the file name of the version you invoke by default.
  127.  
  128.    To reduce the change the size of the plot and position it in the
  129. middle of the display, you could use
  130.  
  131.      graph -h .4 -w .4 -r .2 -u .2 < ascii_data_file |plot
  132.  
  133.    where `h' and `w' are the height and width of the plot and `r' and
  134. `u' indicate how far up and to the right the plot is positioned.
  135.  
  136.    You can put symbols at each data point using
  137.  
  138.      graph -S 2 .01 < ascii_data_file |plot
  139.  
  140.    where 2 indicates which symbol to plot, and .01 indicates it's size.
  141.  
  142.    You can choose the type of line draw on each curve:
  143.  
  144.      graph -m 2 < ascii_data_file |plot
  145.  
  146.    where 2 indicates what kind of line connects the data points.
  147.  
  148. 
  149. File: graphics.info,  Node: Input Files,  Next: Overlaying,  Prev: Invocation,  Up: graph examples
  150.  
  151. The format of input to `graph'
  152. ==============================
  153.  
  154.    As mentioned above, by default `graph' reads ascii pairs of
  155. values, x and y coordinates, from the standard input or files
  156. specified on the command line.  Optional labels may be placed after
  157. each coordinate in the data file.  The label ends at the end of the
  158. line:
  159.  
  160.      3.0  0.4 this is a label for point (3.0, 0.4).
  161.  
  162.    The label must be enclosed in double quotes if it would otherwise
  163. be appear to be a coordinate:
  164.  
  165.      3.0  0.4 "5.0 looks like a value."
  166.  
  167.    You can use the `-b' to break lines after each label in the input.
  168. Use a pair of empty double quotes if you need to break a line, but
  169. do not need a label.
  170.  
  171.      0.0  0.0
  172.      2.0  0.0
  173.      1.0  0.2
  174.      ""
  175.      0.0  0.1
  176.      2.0  0.2
  177.      4.0  0.3
  178.  
  179.    You can also break cuves using `-M' option to break lines whenever
  180. the abscissal values between successive pairs of points decrease. 
  181. When using `-M', each continuous curve has monotonicly increasing
  182. abscissal values.
  183.  
  184.      0.0  0.0 first data set
  185.      2.0  0.0
  186.      4.0  0.2
  187.      0.0  0.1 second data set
  188.      2.0  0.2
  189.      4.0  0.3
  190.  
  191.    `graph' will automaticly generate abscissal values for you if you
  192. specify the `-a' option.  Only ordinate values are given in the
  193. data, and the data is then assumed to be equally sampled along the
  194. abscissa.  The values following `-a' on the command line specify the
  195. sampling interval and the abscissal value of the first data point.
  196.  
  197.      0.0
  198.      0.1
  199.      0.2 label for point (2.0, 0.2)
  200.      0.3
  201.      0.2
  202.      0.3
  203.  
  204. 
  205. File: graphics.info,  Node: Overlaying,  Next: Multiple Plots,  Prev: Input Files,  Up: graph examples
  206.  
  207. Combining several data sets in one plot
  208. =======================================
  209.  
  210.    There are cases where you will want to superimpose several data
  211. sets or several plots on top of each other.  If for example, the
  212. data sets are in seperate files, you can specify each by it's name
  213. on the command line.  Since `graph' reads the standard input only if
  214. no files are named on the command line, you must add the name `--'
  215. if you want `graph' to read the standard input as well.
  216.  
  217.      graph data-file-one data-file-two data-file-three |plot
  218.  
  219.    For comparison sake, you might wish to distinguish the data in one
  220. set from another either by using different symbols at each point or
  221. by distinguishing the type of line draw.  You can do this by
  222. preceeding each file name with options affecting the synbol or line
  223. style used to plot that data.
  224.  
  225.      graph -S 1 data-file-one -S 3 data-file-two -S 4 data-file-three |plot
  226.      
  227.      or
  228.      
  229.      graph -m 1 data-file-one -m 3 data-file-two -S 4 data-file-three |plot
  230.  
  231.    If you need to superimpose several data sets, but must invoke
  232. graph seperately for each, you will have to specify the limits of
  233. the axes.
  234.  
  235.      graph -x 0 100 -y -3 3 -S 3 -m -1 < ascii_data_file_1 >> plot_file
  236.  
  237.    where `-x 0 100' specifies the limits on the x axis, `-y -3 3'
  238. specifies
  239. the limits on the y axis, `-S 2' specifies a box to be drawn at each
  240. point, and `-m -1' specifies that no line is to be draw connecting
  241. the points.  You can overlay a second data set on the first by using:
  242.  
  243.      graph -s -g 0 -x 0 100 -y -3 3 -m 0 < ascii_data_file_1 >> plot_file
  244.  
  245.    where `-s' avoids erasing the page, `-g 0' avoids drawing the
  246. axis, tick marks and labels which were drawn previously, and `-m 0'
  247. specifies that solid lines are draw connecting the points.
  248.  
  249. 
  250. File: graphics.info,  Node: Multiple Plots,  Next: Binary Data,  Prev: Overlaying,  Up: graph examples
  251.  
  252. How to put multiple plots on one page
  253. =====================================
  254.  
  255.    The command
  256.  
  257.      graph -h .4 -w .4 -r .1 -u .1 < ascii_data_file_1 >  plot_file
  258.  
  259.    will put a single box containing the plot in the lower left hand
  260. quarter
  261. of the page.  You can add another plot to the upper left hand corner
  262. of the page using the command
  263.  
  264.      graph -s -h .4 -w .4 -r .1 -u .6 < ascii_data_file_2 >> plot_file
  265.  
  266.    Be sure you use the `-s' option so the the first plot isn't erased.
  267.  
  268.    Likewise you can add plots to the right hand side of the page using
  269.  
  270.      graph -s -h .4 -w .4 -r .6 -u .1 < ascii_data_file_3 >> plot_file
  271.      graph -s -h .4 -w .4 -r .6 -u .6 < ascii_data_file_4 >> plot_file
  272.  
  273.    The tick marks can be moved inside the box and labels moved to the
  274. opposite sides using
  275.  
  276.      graph -T -.005 < ascii_data_file >> plot_file
  277.  
  278. 
  279. File: graphics.info,  Node: Binary Data,  Prev: Multiple Plots,  Up: graph examples
  280.  
  281. Reading other data formats
  282. ==========================
  283.  
  284.    `graph' will read binary data in integer, short integer, float,
  285. and double float format when you use the `-d' option followed by
  286. `f', or `d', respectively.  There are two advantage to using binary
  287. data: 1) `graph' runs significantly faster because the computational
  288. overhead for converting data from ascii to binary is eliminated, and
  289. 2) the input files can be significantly smaller than the ascii
  290. format would be.  Double float is the fastest format to read, while
  291. short integer is the most space conservative.  If you have very
  292. large data sets, using a binary format can reduce storage and
  293. runtime costs.
  294.  
  295.    For example, you can create double float data as output from C
  296. language programs:
  297.  
  298.      #include <stdio.h>
  299.      void write_point (x, y)
  300.        double x, y;
  301.      {
  302.        fwrite(&x, sizeof (double), 1, stdout);
  303.        fwrite(&y, sizeof (double), 1, stdout);
  304.      }
  305.  
  306.    You can then plot data written this way using:
  307.  
  308.      graph -d d <datafile >plotfile
  309.  
  310. 
  311. File: graphics.info,  Node: graph invocation,  Next: plot2ps examples,  Prev: graph examples,  Up: Top
  312.  
  313. Graph Command Line Options
  314. ==========================
  315.  
  316.    The following table describes each of the command line arguments
  317. to graph.  Each option which takes an argument is followed by the
  318. type and default values of the argument in parentheses.
  319.  
  320. `-a [STEP_SIZE [LOWER_LIMIT]]'
  321. `+auto-abscissa [STEP_SIZE [LOWER_LIMIT]]'
  322.      (floats, defaults 1 and 0) Automaticly generate abscissa (x)
  323.      values.  This option specifies that the data contains only
  324.      ordinate (y) values.  The difference between successive x
  325.      values will be STEP_SIZE, and the first x value will be
  326.     
  327.      LOWER_LIMIT.  To return to reading abscissal values from the
  328.      input you can specify `-a 0', which disables automatic
  329.     
  330.      generation of the abscissa and returns STEP_SIZE and
  331.      LOWER_LIMIT to their default values.
  332.  
  333. `-b'
  334. `+break-on-labels'
  335.      Assumes multiple data sets are in the data file, and the data
  336.      sets are separated by a label.  The default is don't break on
  337.      labels.
  338.  
  339. `-M'
  340. `+break-non-monotone'
  341.      When successive abscissa (x) values decrease, a separate data
  342.      set is assumed.  This allows multiple data sets in each file. 
  343.      Similar to `-b'.
  344.  
  345. `-f SIZE'
  346. `+fontsize SIZE'
  347.      Specify the size of the desired font as SIZE points.  Not all
  348.      display devices will honor this command.
  349.  
  350. `-N X|Y'
  351. `+no-label X|Y'
  352.      By default, values at each tick mark are labeled beside the
  353.      axis. This option removes the labeling of the tick marks on the
  354.      specified axis.
  355.  
  356. `-R'
  357. `+dont-round-to-next-tick'
  358.      By default, the ends of the axes are extended to the next tick
  359.      mark.  This option prohibits rounding the limits of the axes to
  360.      the next tick mark.
  361.  
  362. `-c STRING'
  363. `+point-label STRING'
  364.      This option defines STRING as the default label for each point. 
  365.      Any label in the input will override this default.
  366.  
  367. `-S SYMBOL_NUMBER [SYMBOL_SIZE]'
  368. `+symbol SYMBOL_NUMBER [SYMBOL_SIZE]'
  369.      (integer and float, defaults -1 and 0.01) Draw a symbol at each
  370.      point in the data. SYMBOL_NUMBER specifies the shape of the
  371.      symbol according to the following table and SYMBOL_SIZE
  372.      specifies the fractional size of the symbol with respect to the
  373.      height and width of the plot.  Note that you can specify
  374.      symbols to be drawn without any line connecting them by
  375.      specifying the option `-m -1'.
  376.  
  377.     -1 no symbol at all
  378.     0 plus sign (+)
  379.     1 cross (x)
  380.     2 star (*)
  381.     3 box
  382.     4 diamond
  383.     5 circle
  384.     `-T TICK_SIZE'
  385. `+ticksize TICK_SIZE'
  386.      (float, default .01) TICK_SIZE is the fractional size of the
  387.      tick marks on each axis.  A value of 1.0 produces tick marks on
  388.      the x (y) axis whose length is equal to the width (height) of
  389.      the plot.
  390.  
  391. `-X X_LABEL'
  392. `+xtitle X_LABEL'
  393.      (string, default blank) X_LABEL is a label printed below the x
  394.      axis.
  395.  
  396. `-Y Y_LABEL'
  397. `+ytitle Y_LABEL'
  398.      (string, default blank) Y_LABEL is a label printed to the right
  399.      of the y axis.
  400.  
  401. `-d DATA-FORMAT'
  402. `+data-format DATA-FORMAT'
  403.      This specifies what format the input data is in.  Note labels
  404.      can be used only in ascii format input files.
  405.  
  406.     `a'
  407.     `A'
  408.           ascii data
  409.  
  410.     `i'
  411.     `I'
  412.           binary integer data
  413.  
  414.     `s'
  415.     `S'
  416.           binary short integer data
  417.  
  418.     `f'
  419.     `F'
  420.           binary float data
  421.  
  422.     `d'
  423.     `D'
  424.           binary double data
  425.  
  426.     `+debug'
  427.      Debugging information, including the data read in, is sent to
  428.      the standard error output.
  429.  
  430. `-g GRID_STYLE'
  431. `+grid GRID_STYLE'
  432.      (integer, default 1) GRID_STYLE specifies the type of box
  433.      framing the plot and whether grid lines are drawn inside the box.
  434.  
  435.     0 no box around plot, no axes, no labels.
  436.     1 box containing a grid and axes with tick marks and labels.
  437.     2 box around plot, tick marks around the box and labels.
  438.     3 box around plot, ticks on left and lower sides only and labels.
  439.     4 axes intersect at the origin without a box or grid.
  440.     `-h HEIGHT'
  441. `+height-plot HEIGHT'
  442.      (float, default 0.8) HEIGHT specifies the fractional height of
  443.      the plot with respect to the height of the plotting area.  A
  444.      value of 1.0 will produce a box which fills the available area.
  445.      Note that the tick marks and labels are outside this area so
  446.      that values less than 1.0 are generally used.
  447.  
  448. `-L TOP_LABEL'
  449. `+toptitle TOP_LABEL'
  450.      (string, default blank) TOP_LABEL is a label placed above the
  451.      plot.
  452.  
  453. `-m LINE_MODE'
  454. `+linestyle LINE_MODE'
  455.      (integer, default 0) LINE_MODE specifies the mode (or style) of
  456.      lines drawn between data points.
  457.  
  458.     -1 no line at all
  459.     0 solid
  460.     1 dotted
  461.     2 shortdashed
  462.     3 dotdashed
  463.     4 longdashed
  464.     5 disconnected
  465.     `-r RIGHT'
  466. `+right-margin-posn RIGHT'
  467.      (float, default 0.1) Move the plot to the right by a fractional
  468.      amount RIGHT with respect to the width of the plotting area. 
  469.      This produces a margin on the left hand side of the plot.  A
  470.      value of 0.5 will produce a margin half the width of the
  471.      available area.  Note that the tick marks and labels are drawn
  472.      in the margin.
  473.  
  474. `-u UP'
  475. `+bottom-margin-posn UP'
  476.      (float, default 0.1) Move the plot up by a fractional amount UP
  477.      with respect to the height of the plotting area.  This produces
  478.      a margin below the plot.  A value of 0.5 will produce a margin
  479.      half the height of the available area.  Note that the tick
  480.      marks and labels are drawn in the margin.
  481.  
  482. `-s'
  483. `+save-screen'
  484.      Save the screen. This option prevent graph from erasing the
  485.      previous contents of the graphics window or device.
  486.  
  487. `-t'
  488. `+transpose'
  489.      Transpose the abscissa and ordinate.  This option causes the
  490.      axes to be interchanged, and the options which apply to each
  491.      axis to be applied to the opposite axis.  That is, data is read
  492.      in as (y, x) pairs and `-x', `-X' and `-lx' apply to the y axis.
  493.  
  494. `-w WIDTH'
  495. `+width-plot WIDTH'
  496.      (float, default 0.8) WIDTH specifies the fractional width of the
  497.      plot with respect to the width of the plotting area.  A value
  498.      of 1.0 will produce a box which fills the available area.  Note
  499.      that the tick marks and labels are outside this area, so values
  500.      less than 1.0 are generally used.
  501.  
  502. `-x LOWER_LIMIT UPPER_LIMIT'
  503. `+xlimits LOWER_LIMIT UPPER_LIMIT'
  504.      (floats) The arguments LOWER_LIMIT and UPPER_LIMIT specify the
  505.      limits of the x axis. By default the upper and lower limits are
  506.      taken from the data.  If unspecified the limits of the data are
  507.      used.
  508.  
  509. `-y LOWER_LIMIT UPPER_LIMIT'
  510. `+ylimits LOWER_LIMIT UPPER_LIMIT'
  511.      These arguments specify the scale and limits of the y axis as
  512.      for the x axis above.
  513.  
  514. `-l X|Y'
  515. `+log-axis X|Y'
  516.      The argument indicates which axis should be a log axis.  Either
  517.      one or both x- and y-axes can be specified by using the
  518.      appropriate letter.  Use XY or YX to specify both.
  519.  
  520. `+high-byte-first'
  521. `+low-byte-first'
  522.      These options force graph to use the specified byte order when
  523.      writing out the plot file.  By default the byte order is host
  524.      dependent.
  525.  
  526. 
  527. File: graphics.info,  Node: plot2ps examples,  Next: plot2ps invocation,  Prev: graph invocation,  Up: Top
  528.  
  529. Examples Using `plot2ps'
  530. ========================
  531.  
  532.    To produce a plot of data arranged in ordered pairs of x and y
  533. coordinates in an ASCII file, you can use:
  534.  
  535.      graph <asciiDataFile | plot2ps | lpr -Plw
  536.  
  537.    To create a simple PostScript figure you can use:
  538.  
  539.      echo 0 0 1 1 2 0 | spline | graph | plot2ps > test.ps
  540.  
  541.    To edit the plot:
  542.  
  543.      idraw test.ps
  544.  
  545.    To use the previewer to look at the plot:
  546.  
  547.      gs test.ps
  548.  
  549. 
  550. File: graphics.info,  Node: plot2ps invocation,  Next: xplot,  Prev: plot2ps examples,  Up: Top
  551.  
  552. Plot2ps Command Line Options
  553. ============================
  554.  
  555.    `plot2ps' is a relatively simple utility in that there are few
  556. command line options to choose from.  The plot file format does not
  557. contain methods for specifying font or font size, so you must
  558. specify these things with options.  There are no other options for
  559. controlling the picture.
  560.  
  561.    The plot file format is machine dependent on the byte order of
  562. unformatted, signed, two byte integer coordinates contained in plot
  563. commands.  The `-high-byte-first' or `-low-byte-first' option
  564. specifies this order explicitly.  `plot2ps' attempts to determine
  565. the byte order from commands early in the plot file, but the method
  566. is heuristic and is not foolproof.  Several standard plot sizes
  567. specified by the `open' command are used to recognize byte order by
  568. `plot2ps'.  If these sizes are recognized in byte reversed order,
  569. `plot2ps'
  570. adjusts accordingly.  These sizes include 504x504, 2048x2048
  571. (versatek plotters), 2100x2100, 3120x3120(tektronix 4010 terminals)
  572. and 4096x4096 (gsi 300 terminals).
  573.  
  574.    The remaining command line options may be used specify an
  575. alternate PostScript prologue and to print the licensing information.
  576.  
  577.    Input plot files names may be specified anywhere on the command
  578. line.  If no file names are specified, or the name `-' is specified,
  579. the standard input is read for plotting instructions.  Only the font
  580. or font size options which precede a file name will affect the text
  581. for that file.
  582.  
  583. `-H'
  584. `+help'
  585.      The help option prints a summary of command line syntax for
  586.      `plot2ps', a list of the font names (the standard builtin
  587.      PostScript fonts), and version, copyright and warranty
  588.      information.  Specifying this options causes plot2ps to ignore
  589.      files on the standard input.  You can specify a file on the
  590.      standard input explicitly with the option `-' if you want it to
  591.      read the standard input as well.
  592.  
  593. `-v'
  594. `-V'
  595. `+version'
  596.      This option prints version, copyright and warranty information.
  597.  
  598. `-fontsize SIZE'
  599. `-f SIZE'
  600.      The fontsize options specifies the default size in printer's
  601.      points (1/72 inch) of all text appearing in the plot.  If
  602.      unspecified, the size defaults to 14 points.
  603.  
  604.      Some sizes are supported better than others under X windows. 
  605.      The standard sizes distributed with X windows are 8, 10, 12,
  606.      14, 18, and 24 points.  Text at these point sizes will display
  607.      correctly in the `idraw' editor.  Other font sizes will print
  608.      correctly on a PostScript device such as the laserwriter, but
  609.      may not appear at the correct size in the `idraw' editor.
  610.  
  611. `-font NAME'
  612. `-fo NAME'
  613.      The font name option specifies the name of the default font for
  614.      all text appearing in the plot.  `plot2ps -help' prints a
  615.      listing of the font names on the standard output.  These names
  616.      include the available builtin fonts on standard PostScript
  617.      printers.
  618.  
  619. `-high-byte-first'
  620. `-h'
  621.      The high-byte-first option specifies explicitly that the higher
  622.      order byte of each signed, two byte integer occurs first in the
  623.      file.  It disables determination of byte order from the file
  624.      itself.
  625.  
  626. `-line-width WIDTH'
  627.      WIDTH is the width of lines drawn in the plot, and defaults to a
  628.      value of 0.  A value of 0 will produce the thinest line
  629.      possible in a device dependent fashion, however this is known
  630.      to cause problems for older versions of idraw.  The line width
  631.      is device independent for a positive values of WIDTH.
  632.  
  633. `-low-byte-first'
  634. `-l'
  635.      The low-byte-first option specifies explicitly that the lower
  636.      order byte of each signed, two byte integer occurs first in the
  637.      file.  It disables determination of byte order from the file
  638.      itself.
  639.  
  640. `-prologue FILENAME'
  641. `-p FILENAME'
  642.      The prologue option specifies the name of an alternate
  643.      PostScript prologue FILENAME to be used in place of the default
  644.     
  645.      `idraw' prologue.  The prologue declares procedures used to
  646.      draw each graphic object.  The default prologue was generously
  647.      provided by John Interante and is a part of the InterViews
  648.      distribution, version 2.5.
  649.  
  650. `-copying'
  651. `-warranty'
  652.      The copying and warranty options print a copy of the GNU General
  653.      Public License on the standard error output.  Included is
  654.      conditions for copying `plot2ps' and information on the lack of
  655.      any warranty.
  656.  
  657.      These conditions do not cover the output of `plot2ps'.  The only
  658.      conditions imposed on the output are those which come from the
  659.      prologue that you are using.
  660.  
  661. `-signed'
  662. `-unsigned'
  663.      The signed and unsigned options specify whether coordinates in
  664.      the plot file are signed.  By convention, coordinates are
  665.      always signed.  Some plot files do not follow this convention,
  666.      and you can use the unsigned option to convert those files.
  667.  
  668. `-bbox'
  669.      The bbox option specifies that a bounding box comment will be
  670.      written at the end of the output file.  This information is
  671.      useful for document preparation systems which determine how to
  672.      size and place the figure using the bounding box.  See also the
  673.      atend script.
  674.  
  675. 
  676. File: graphics.info,  Node: xplot,  Next: xplot invocation,  Prev: plot2ps invocation,  Up: Top
  677.  
  678. A plot file previewer for X11
  679. =============================
  680.  
  681.    `xplot' is a plot file previewer for the X window system.  It
  682. reads GNU plot commands from its standard input and draws the
  683. resulting graphics in an X window.
  684.  
  685.    After xplot reaches the end-of-file on the input, it puts itself
  686. in the background (forks).  Control returns to the calling program,
  687. while xplot continues, remaining on screen.
  688.  
  689.    To exit, click the left mouse button in the xplot window.  Note
  690. that xplot ignores SIGHUP signals, so you must use another signal to
  691. kill xplot if necessary.
  692.  
  693. 
  694. File: graphics.info,  Node: xplot invocation,  Next: Plot2fig Examples,  Prev: xplot,  Up: Top
  695.  
  696. Xplot Options
  697. =============
  698.  
  699.    `xplot' accepts all of the standard X toolkit command line
  700. options, and the initial geometry specification determines the
  701. resolution, with a default geometry of 500x500 pixels.
  702.  
  703.    The following standard X Toolkit command line arguments may be
  704. used with `xplot':
  705.  
  706. `-bg COLOR'
  707.      This specifies the color to use for the background of the
  708.      window.   The default is WHITE.
  709.  
  710. `-bd COLOR'
  711.      This specifies the color to use for the border of the window. 
  712.      The default is BLACK.
  713.  
  714. `-bw NUMBER'
  715.      This specifies the width in pixels of the border surrounding the
  716.      window.
  717.  
  718. `-fg COLOR'
  719.      This specifies the color to use for displaying text.  The
  720.      default is  BLACK.
  721.  
  722. `-fn FONT'
  723.      This specifies the font to be used for displaying normal text. 
  724.      The default is 6X10.
  725.  
  726. `-rv'
  727.      This indicates that reverse video should be simulated by
  728.      swapping the foreground and background colors.
  729.  
  730. `-geometry GEOMETRY'
  731.      This specifies the preferred size and position of the plot window.
  732.  
  733. `-display HOST:DISPLAY'
  734.      This specifies the X server to contact.
  735.  
  736. `-xrm RESOURCESTRING'
  737.      This specifies a toolkit resource property.  See the manual page
  738.      for xrdb.
  739.  
  740.    `xplot' uses the athena Command widget in the X Toolkit.  So, it
  741. understands all of the core resource names and classes as well as:
  742.  
  743. `reverseVideo'
  744.      (class ReverseVideo) Specifies that the foreground and
  745.      background colors should be reversed.
  746.  
  747. Example
  748. -------
  749.  
  750.    The resources:
  751.  
  752.      Xplot.font: 6x9
  753.      Xplot.geometry: 300x300
  754.  
  755.    will set the font used in the plot window to `6x9' and the size of
  756. the window to 300 by 300 pixels.
  757.  
  758. 
  759. File: graphics.info,  Node: Plot2fig Examples,  Next: plot2fig invocation,  Prev: xplot invocation,  Up: Top
  760.  
  761. Using Plot2fig
  762. ==============
  763.  
  764.    To create a simple plot file one can use:
  765.  
  766.      echo 0 0 1 1 2 0 | spline | graph | plot2fig > test.fig
  767.  
  768.    To edit the plot:
  769.  
  770.      fig test.fig
  771.  
  772.    To convert the fig file into dvi code, create a latex file
  773. containing  a document which includes the figure:
  774.  
  775.      \\documentstyle\[\]{article}
  776.      \\begin{document}
  777.      \\input{test}
  778.      \\end{document}
  779.  
  780.    Then, run transfig on the figure and latex on the document:
  781.  
  782.      % transfig -L latex test.fig
  783.      % make test.tex
  784.      % latex t.tex
  785.  
  786.    To edit a plot of data arranged in ordered pairs of x and y
  787. coordinates in an ascii file, one can use:
  788.  
  789.      % graph <asciiDataFile | plot2fig >file.fig
  790.      % fig file.fig
  791.  
  792. 
  793. File: graphics.info,  Node: plot2fig invocation,  Next: plot2tek invocation,  Prev: plot2fig examples,  Up: Top
  794.  
  795. A plot file to fig file translator
  796. ==================================
  797.  
  798.    `plot2fig' reads plotting instructions from the specified input
  799. files and/or the standard input and produces `Fig' compatible code
  800. on it's standard output.  This output file can be edited with the
  801. fig (Facility for Interactive Generation of figures) graphics
  802. editor.  The output can subsequently be converted to pictex,
  803. PostScript, latex, epic, eepic, and tpic languages using the
  804. `transfig' translator.
  805.  
  806.    Any unrecognized options on the command line are assumed to be
  807. input files.  The standard input is read by default only if no other
  808. files specified on the command line are successfully opened.  A
  809. single dash (-) on the command line indicates the standard input is
  810. to be read.  Each option is set and each file read in the order they
  811. are specified on the command line.
  812.  
  813.    For compatibility with pic2fig, plot2fig ignores leading white
  814. space in labels.  Labels containing all white space are ignored.
  815.  
  816. `-fn NAME'
  817. `-fontname NAME'
  818.      Default: the default font of the transfig output device.  This
  819.      option sets the font for all subsequent text to NAME. 
  820.      Recognized font names are typewriter, modern, italic, bold, and
  821.      times.  In addition, courier is an alias for typewriter and
  822.      roman is an alias for times.  Note that the fonts are device
  823.      dependent.
  824.  
  825. `-fs SIZE'
  826. `-fontsize SIZE'
  827.      Default: 12. This option sets the size of subsequent text to
  828.      SIZE (in printer's points).
  829.  
  830. `-h'
  831. `-high-byte-first'
  832.      This option specifies that the byte ordering of two byte
  833.      integers in the input plot file is high byte first.
  834.  
  835. `-l'
  836. `-low-byte-first'
  837.      This option specifies that the byte ordering of two byte
  838.      integers in the input plot file is low byte first.
  839.  
  840. `-warranty'
  841. `-copying'
  842.      This option prints out the copying conditions and warranty
  843.      information.
  844.  
  845. `-signed'
  846. `-unsigned'
  847.      Default: signed.  This option specifies whether two byte
  848.      integers in the input plot file are unsigned or signed.
  849.  
  850. `-'
  851.      This option specifies explicitly that the standard input should
  852.      be read for plotting instructions.
  853.  
  854. 
  855. File: graphics.info,  Node: plot2tek invocation,  Next: latex example,  Prev: plot2fig invocation,  Up: Top
  856.  
  857. Tektronix 4010 output
  858. =====================
  859.  
  860. `-H'
  861. `+help'
  862.      The help option prints a summary of command line syntax, a list
  863.      of the known font names, and version, copyright and warranty
  864.      information.  Specifying this options causes plot to ignore the
  865.      standard input, so you must specify the option `-' if you want
  866.      it to read the standard input as well.
  867.  
  868. `-v'
  869. `-V'
  870. `+version'
  871.      This option prints version, copyright and warranty information.
  872.  
  873. `-f SIZE'
  874. `+fontsize SIZE'
  875.      The fontsize options specifies the default size in printer's
  876.      points (1/72 inch) of all text appearing in the plot.  If
  877.      unspecified, the size defaults to 14 points.
  878.  
  879. `+high-byte-first'
  880. `+low-byte-first'
  881.      These options force graph to use the specified byte order when
  882.      writing out the plot file.  By default the byte order is host
  883.      dependent.
  884.  
  885. `-F NAME'
  886. `+fontname NAME'
  887.      The font name option specifies the name of the default font for
  888.      all text appearing in the plot.  `plot -help' prints a listing
  889.      of the font names on the standard output.  These names include
  890.      the available builtin fonts on standard PostScript printers.
  891.  
  892. `-h'
  893. `+high-byte-first'
  894.      The high-byte-first option specifies explicitly that the higher
  895.      order byte of each signed, two byte integer occurs first in the
  896.      file.  It disables determination of byte order from the file
  897.      itself.
  898.  
  899. `-l'
  900. `+low-byte-first'
  901.      The low-byte-first option specifies explicitly that the lower
  902.      order byte of each signed, two byte integer occurs first in the
  903.      file.  It disables determination of byte order from the file
  904.      itself.
  905.  
  906. `-p FILENAME'
  907. `+prologue FILENAME'
  908.      The prologue option specifies the name of an alternate
  909.      PostScript prologue FILENAME to be used in place of the default
  910.     
  911.      `idraw' prologue.  The prologue declares procedures used to
  912.      draw each graphic object.  The default prologue was generously
  913.      provided by John Interante and is a part of the InterViews
  914.      distribution, version 2.5.
  915.  
  916. `+copying'
  917. `+C'
  918. `+warranty'
  919. `+W'
  920.      The copying and warranty options print a copy of the GNU General
  921.      Public License on the standard error output.  Included is
  922.      conditions for copying `plot' and information on the lack of
  923.      any warranty.
  924.  
  925. `-s'
  926. `+signed-input'
  927. `-u'
  928. `+unsigned-input'
  929.      The signed and unsigned options specify whether coordinates in
  930.      the plot file are signed.  By convention, coordinates are
  931.      always signed.  Some plot files do not follow this convention,
  932.      and you can use the unsigned option to convert those files.
  933.  
  934. 
  935. File: graphics.info,  Node: latex example,  Next: psfig,  Prev: plot2tek invocation,  Up: Top
  936.  
  937. Including a Figure in an Article
  938. ================================
  939.  
  940.    This is an example of LaTeX code which places the figure generated
  941. in the previous example in a page of text.
  942.  
  943.      \documentstyle[]{article}
  944.      \input{psfig}
  945.      \begin{document}
  946.      \title{Title of the article.}
  947.      \author{The Author's name}
  948.      \maketitle
  949.      This is an example of how to include PostScript figures in LaTeX documents.
  950.      \begin{figure}[h]
  951.      \centerline{\psfig{figure=test.ps,height=3in}}
  952.      \caption{Here is a description of the figure which will appear below it.}
  953.      \end{figure}
  954.      Note that the above figure was included using dvips.
  955.      \end{document}
  956.  
  957.    If the above LaTeX code is contained in a file called `mytext.tex'
  958. you
  959. can use the commands
  960.  
  961.      latex mytext
  962.      dvips mytext.dvi >mytext.ps
  963.      lpr -Plw mytext.ps
  964.  
  965.    to format and print the example text.
  966.  
  967. 
  968. File: graphics.info,  Node: psfig,  Next: atend.pl,  Prev: latex example,  Up: Top
  969.  
  970. Options to `psfig' for Including Figures
  971. ========================================
  972.  
  973.    `psfig' is a LaTeX command used to insert a PostScript figure into
  974. a document.
  975.  
  976.    `psfig' can be used to insert `plot2ps' generated PostScript into
  977. a LaTeX document.  The placement of the `psfig' command tells LaTeX
  978. where in the document to place the PostScript, and arguments to the
  979. command give the name of the file containing the PostScript, and the
  980. desired size of the figure.  Arguments are separated by commas or
  981. blanks, and are of the form `KEYWORD=VALUE'.  The following is a
  982. list of valid arguments for the `psfig' command:
  983.  
  984. `file=NAME'
  985.      The file name of the PostScript figure.
  986.  
  987. `height=SIZE'
  988.      The height of the figure (eg. 3in).  If you specify only a
  989.      height or only a width, the width and height are scaled
  990.      equally.  If you specify both a width and a height the aspect
  991.      ratio will be affected.
  992.  
  993. `width=SIZE'
  994.      The width of the figure (eg. 3in).
  995.  
  996. `bbllx=COORDINATE'
  997.      The bounding box lower left-hand x coordinate.  Any PostScript
  998.      file which conforms to the PostScript Document Structuring
  999.      Conventions version 2.0 should contain a bounding box
  1000.      information at the head of the file.  `plot2ps' output conforms
  1001.      to the version 2.0 conventions so that you should not need to
  1002.      use any of the bounding box options.
  1003.  
  1004. `bblly=COORDINATE'
  1005.      The bounding box lower left-hand y coordinate.
  1006.  
  1007. `bburx=COORDINATE'
  1008.      The bounding box upper right-hand x coordinate.
  1009.  
  1010. `bbury=COORDINATE'
  1011.      The bounding box upper right-hand y coordinate.
  1012.  
  1013. `rheight=SIZE'
  1014.      Horizontal space to reserve for the figure.
  1015.  
  1016. `rwidth=SIZE'
  1017.      Vertical space to reserve for the figure.
  1018.  
  1019. `clip='
  1020.      Clip the figure.  `clip=' is a switch and takes no value, but
  1021.      the `=' must be present.  This option is useful for including
  1022.      PostScript figures which use the size of the clipping path to
  1023.      size themselves.
  1024.  
  1025. 
  1026. File: graphics.info,  Node: atend.pl,  Next: dvips,  Prev: psfig,  Up: Top
  1027.  
  1028. A perl script for use with psfig
  1029. ================================
  1030.  
  1031.    `atend.pl' is a perl script which moves the bounding box comment
  1032. from the trailer to the header.  Although either is legal, most
  1033. document preparation software, such as `psfig', will only accept
  1034. bounding box comments in the header.  If you use `psfig' and the
  1035. `-bbox' option togeather, run `atend.pl' on the output of `plot2ps'
  1036. before importing the graphics using `psfig'.
  1037.  
  1038.    `atend.pl' can be used as a filter:
  1039.  
  1040.      echo 0 0 1 1 2 0 | spline | graph >spline.pl
  1041.      plot2ps -bbox |atend.pl - >spline.ps
  1042.  
  1043.    Or, `atend.pl' can be used to fix the output file in place:
  1044.  
  1045.      echo 0 0 1 1 2 0 | spline | graph |plot2ps -bbox >spline.ps
  1046.      atend.pl spline.ps
  1047.  
  1048. 
  1049. File: graphics.info,  Node: dvips,  Next: idraw,  Prev: atend.pl,  Up: Top
  1050.  
  1051. How to Get `dvips'
  1052. ==================
  1053.  
  1054.    The `dvips' utility mentioned previously is used convert dvi files
  1055. generated by LaTeX into post-script.  It also has support for
  1056. inclusion of PostScript figures into LaTeX documents.  It is
  1057. available via anonymous ftp from `labrea.stanford.edu' (36.8.0.47). 
  1058. Look for `pub/dvips.tar.Z'.
  1059.  
  1060. 
  1061. File: graphics.info,  Node: idraw,  Next: ghostscript,  Prev: dvips,  Up: Top
  1062.  
  1063. How to Get `idraw'
  1064. ==================
  1065.  
  1066.    The `idraw' utility mentioned previously is an interactive
  1067. graphics editor which is distributed with InterViews.  InterViews is
  1068. available via anonymous ftp from `interviews.stanford.edu'
  1069. (36.22.0.175) in the file `InterViews/2.5.tar.Z'.
  1070.  
  1071. 
  1072. File: graphics.info,  Node: ghostscript,  Next: libps,  Prev: idraw,  Up: Top
  1073.  
  1074. How to Get `ghostscript'
  1075. ========================
  1076.  
  1077.    Ghostscript is a previewer which is intended to be compatible with
  1078. the PostScript language.  It supports several output devices
  1079. including the X window system and ega displays.  Version 2.0 is
  1080. suitable for previewing LaTeX documents with imbedded encapsulated
  1081. PostScript figures, the type of PostScript figures generated by
  1082. plot2ps and idraw.  It is available via anonymous ftp from
  1083. `prep.ai.mit.edu' (18.71.0.38) - Look for `pub/gnu/ghostscript.tar.Z'.
  1084.  
  1085. 
  1086. File: graphics.info,  Node: libps,  Next: files,  Prev: ghostscript,  Up: Top
  1087.  
  1088. `libps', a Library of Plot Functions
  1089. ====================================
  1090.  
  1091.    Libps is a library of plot functions for drawing graphic object
  1092. using PostScript.  Before drawing any objects or using any of the
  1093. other functions, a program should call `openpl'.  Before exiting and
  1094. after all other libps calls a program should call `closepl'.
  1095.  
  1096. * Menu:
  1097.  
  1098. The standard plot library includes:
  1099.  
  1100. * arc::          draw an arc
  1101. * circle::       draw a circle
  1102. * closepl::      close the device for output
  1103. * cont::     continue a line
  1104. * erase::        erase the page
  1105. * label::        print a label
  1106. * line::         draw a line
  1107. * linemod::      change the line mode (style)
  1108. * move::         move to a new coordinate
  1109. * openpl::       open the device for output
  1110. * point::        draw a point
  1111. * space::        define the user's plot space (size)
  1112.  
  1113. The extensions provided only in libps to take advantage of PostScript
  1114. features include:
  1115.  
  1116. * alabel::       print a vertically or horizontally justified label
  1117. * color::        change the color
  1118. * fill::         fill pattern for closed paths
  1119. * fontname::     set the font name
  1120. * fontsize::     set the font size
  1121. * rotate::       rotate subsequent text
  1122.  
  1123. 
  1124. File: graphics.info,  Node: alabel,  Next: arc,  Up: libps
  1125.  
  1126. `alabel'
  1127. --------
  1128.  
  1129.    int `alabel' (char X_JUSTIFY, char Y_JUSTIFY, char *LABEL);
  1130.  
  1131.    `alabel' takes three arguments X_JUSTIFY, Y_JUSTIFY, and LABEL and
  1132. places the label according to the x and y axis adjustments specified
  1133. in X_JUSTIFY and Y_JUSTIFY respectively.  X_JUSTIFY is a character
  1134. containing either `l', `c', or `r' for left, center or right
  1135. justified with respect to the current x coordinate.  Y_JUSTIFY is a
  1136. character containing either `b', `c', or `t' for placing the bottom
  1137. center or top of the label even with the current y coordinate. 
  1138. *LABEL is a string containing the label.  The current point is moved
  1139. to follow the end of the text.
  1140.  
  1141.    *Note fontname:: on how to change the default font.  *Note
  1142. fontsize:: on how to change the font size.
  1143.  
  1144. 
  1145. File: graphics.info,  Node: arc,  Next: circle,  Prev: alabel,  Up: libps
  1146.  
  1147. `arc'
  1148. -----
  1149.  
  1150.    int `arc' (int X, int Y, int X0, int Y0, int X1, int Y1)
  1151.  
  1152.    `arc' takes six integer arguments specifying the coordinates of
  1153. the center (X, Y), beginning (X0, Y0), and ending (X1, Y1) of a
  1154. circular arc.  The current point becomes (X, Y).
  1155.  
  1156. 
  1157. File: graphics.info,  Node: circle,  Next: closepl,  Prev: arc,  Up: libps
  1158.  
  1159. `circle'
  1160. --------
  1161.  
  1162.    int `circle' (int X, int Y, int R)
  1163.  
  1164.    `circle' takes three integer arguments specifying the center (X,
  1165. Y) of the circle and its radius (R).  The current point becomes (X,
  1166. Y).
  1167.  
  1168. 
  1169. File: graphics.info,  Node: closepl,  Next: color,  Prev: circle,  Up: libps
  1170.  
  1171. `closepl'
  1172. ---------
  1173.  
  1174.    int `closepl' ()
  1175.  
  1176.    `closepl' takes no arguments.  It merely outputs the PostScript
  1177. trailer containing a `showpage' command.
  1178.  
  1179. 
  1180. File: graphics.info,  Node: color,  Next: cont,  Prev: closepl,  Up: libps
  1181.  
  1182. `color'
  1183. -------
  1184.  
  1185.    int `color' (int RED, int GREEN, int BLUE);
  1186.  
  1187.    `color' sets the foreground color of all the following objects. 
  1188. The arguments RED, GREEN and BLUE indicate the intensity of red,
  1189. green and blue components of the foreground color respectively. 
  1190. Each is a unsigned integer specifying an intensity in the range from
  1191. 0 to 0xFFFF.  A value of (0, 0, 0) represents black and a value of
  1192. (0xFFFF, 0xFFFF, 0xFFFF) indicates white.
  1193.  
  1194. 
  1195. File: graphics.info,  Node: cont,  Next: erase,  Prev: color,  Up: libps
  1196.  
  1197. `cont'
  1198. ------
  1199.  
  1200.    int `cont' (int X, int Y)
  1201.  
  1202.    `cont' takes two integer arguments specifying the coordinate (X,
  1203. Y) for the continuation of a line.  This draws a line segment from
  1204. the current point to the point (X, Y).  The current point then
  1205. becomes (X, Y).
  1206.  
  1207. 
  1208. File: graphics.info,  Node: erase,  Next: fill,  Prev: cont,  Up: libps
  1209.  
  1210. `erase'
  1211. -------
  1212.  
  1213.    int `erase' ()
  1214.  
  1215.    `erase' normally erases all the graphics from the display before a
  1216. plot is viewed.  Since we start off with a blank page in PostScript
  1217. and `idraw' this function does nothing.
  1218.  
  1219. 
  1220. File: graphics.info,  Node: fill,  Next: fontname,  Prev: erase,  Up: libps
  1221.  
  1222. `fill'
  1223. ------
  1224.  
  1225.    int `fill' (int LEVEL);
  1226.  
  1227.    `fill' sets the intensity of the filler for closed paths.  The
  1228. argument LEVEL indicates the grey level of the fill pattern.  It's
  1229. value ranges from 1 to 0xFFFF.  A value of 1 represents black and a
  1230. value of 0xFFFF indicates white.  A value of 0 represents no fill,
  1231. or transparent.
  1232.  
  1233. 
  1234. File: graphics.info,  Node: fontname,  Next: fontsize,  Prev: fill,  Up: libps
  1235.  
  1236. `fontname'
  1237. ----------
  1238.  
  1239.    int `fontname' (char *FONT_NAME);
  1240.  
  1241.    `fontname' takes a single string argument, FONT_NAME, specifying
  1242. the name of the font to be used for following text.  The laser
  1243. writer builtin fonts are supported:
  1244.  
  1245.              courier-bold
  1246.              courier-boldoblique
  1247.              courier-oblique
  1248.              courier
  1249.              helvetica-bold
  1250.              helvetica-boldoblique
  1251.              helvetica-oblique
  1252.              helvetica
  1253.              symbol
  1254.              times-bold
  1255.              times-bolditalic
  1256.              times-italic
  1257.              times-roman
  1258.  
  1259. 
  1260. File: graphics.info,  Node: fontsize,  Next: label,  Prev: fontname,  Up: libps
  1261.  
  1262. `fontsize'
  1263. ----------
  1264.  
  1265.    int `fontsize' (int SIZE);
  1266.  
  1267.    `fontsize' takes a single integer argument SIZE in printer's
  1268. points (1/72 inch) and sets the font size accordingly.
  1269.  
  1270. 
  1271. File: graphics.info,  Node: label,  Next: line,  Prev: fontsize,  Up: libps
  1272.  
  1273. `label'
  1274. -------
  1275.  
  1276.    int `label' (char *S)
  1277.  
  1278.    `label' takes a single string argument S and draws the text
  1279. contained in S at the most recently used coordinate in the current
  1280. font.  By default the text is left justified and centered vertically
  1281. with respect to the current coordinate.
  1282.  
  1283. 
  1284. File: graphics.info,  Node: line,  Next: linemod,  Prev: label,  Up: libps
  1285.  
  1286. `line'
  1287. ------
  1288.  
  1289.    int `line' (int X1, int y1, int X2, int Y2)
  1290.  
  1291.    `line' takes four integer arguments specifying the beginning (X1,
  1292. Y1) and ending (X2, Y2) points of a line.  The current point becomes
  1293. (X2, Y2).
  1294.  
  1295.    *Note linemod:: for how to specify the style or pattern of line.
  1296.  
  1297. 
  1298. File: graphics.info,  Node: linemod,  Next: move,  Prev: line,  Up: libps
  1299.  
  1300. `linemod'
  1301. ---------
  1302.  
  1303.    int `linemod' (char *S)
  1304.  
  1305.    `linemod' takes a single string argument S containing the name of
  1306. the line style desired.  The names supported are longdashed,
  1307. disconnected, dotdashed, dotted, solid and shortdashed.  These
  1308. correspond to the following sixteen bit patterns:
  1309.  
  1310.      solid             --------------------------------
  1311.      longdashed        -------         -------         
  1312.      disconnected      -               -               
  1313.      dotdashed         -----------  -  -----------  -  
  1314.      dotted            - - - - - - - - - - - - - - - - 
  1315.      shortdashed       --              --
  1316.  
  1317. 
  1318. File: graphics.info,  Node: move,  Next: openpl,  Prev: linemod,  Up: libps
  1319.  
  1320. `move'
  1321. ------
  1322.  
  1323.    int `move' (int X, int Y)
  1324.  
  1325.    `move' takes two integer arguments specifying the coordinate (X,
  1326. Y) for the beginning of a new line.  This is equivalent to lifting
  1327. the pen on a plotter and moving it to a new position without drawing
  1328. any line.  The current point becomes (X, Y).
  1329.  
  1330. 
  1331. File: graphics.info,  Node: openpl,  Next: point,  Prev: move,  Up: libps
  1332.  
  1333. `openpl'
  1334. --------
  1335.  
  1336.    int `openpl' ()
  1337.  
  1338.    `openpl' normally opens the device.  For PostScript we just print
  1339. out the PostScript prologue.  The following global variables defined
  1340. in `openpl' specify what prologue is written to the output.
  1341.  
  1342.    USER_HAS_PROLOGUE is a flag.  If it is non-zero then the open
  1343. routine should output the user specified prologue contained in the
  1344. file specified in the string USERS_PROLOGUE.
  1345.  
  1346.    USERS_PROLOGUE is a string containing the file name for any user
  1347. specified PostScript prologue.  This file is a substitute for the
  1348. default prologue.
  1349.  
  1350. 
  1351. File: graphics.info,  Node: point,  Next: rotate,  Prev: openpl,  Up: libps
  1352.  
  1353. `point'
  1354. -------
  1355.  
  1356.    int `point' (int X, int Y)
  1357.  
  1358.    `point' takes a pair of integer arguments specifying the
  1359. coordinate (X, Y) for a single point.  The current point then
  1360. becomes (X, Y).
  1361.  
  1362. 
  1363. File: graphics.info,  Node: rotate,  Next: space,  Prev: point,  Up: libps
  1364.  
  1365. `rotate'
  1366. --------
  1367.  
  1368.    int `rotate' (int ANGLE);
  1369.  
  1370.    `rotate' takes three integer arguments.  The last argument, ANGLE,
  1371. specifies the angle in degrees counter-clockwise from the x
  1372. (horizontal) axis following text.
  1373.  
  1374. 
  1375. File: graphics.info,  Node: space,  Prev: rotate,  Up: libps
  1376.  
  1377. `space'
  1378. -------
  1379.  
  1380.    int `space' (int X0, int Y0, int X1, int Y1)
  1381.  
  1382.    `space' takes two pair of integers arguments specifying the lower,
  1383. left-hand and upper, right-hand limits of the range of plot
  1384. coordinates.  The scaling of input to output coordinate conversion
  1385. is adjusted to fit these ranges into the page.  Note however that if
  1386. the ranges of x and y coordinates are different the smallest scaling
  1387. of
  1388. the
  1389. two is used to avoid affecting the aspect ratio of the plot.  This
  1390. means that although the plot is scaled to fit on the page, the axes
  1391. are not stretched with respect to each other.
  1392.  
  1393. 
  1394. File: graphics.info,  Node: files,  Next: Acknowledgements,  Prev: libps,  Up: Top
  1395.  
  1396. The Plot File Format
  1397. ====================
  1398.  
  1399.    The plot file is a set of plotting commands and data.  Each
  1400. command is a single ascii character indicating which operation is to
  1401. be performed.  The data following a command is either a newline
  1402. terminated ascii string or several signed, two byte integers in
  1403. binary format.  For example, the command to move the current point
  1404. to the coordinate (3,5) would be `m\000\003\000\005'.
  1405.  
  1406.    Note that the byte order of the binary representation of the
  1407. signed, two byte integers is machine dependent, so on some machines,
  1408. this command might appear as `m\003\000\005\000'.  `plot2ps' tries
  1409. to guess the byte order from the arguments to the `openpl' command
  1410. and adjust the order accordingly.
  1411.  
  1412.    The following table lists each single character commands followed
  1413. by the name of the corresponding libps function called to handle the
  1414. data and a description of the command and data.
  1415.  
  1416. `Command'
  1417.      Description
  1418.  
  1419. `a'
  1420.      The arc command is followed by three pair of signed, two byte
  1421.      integers indicating the center, starting and ending points for
  1422.      a circular arc.  The center becomes the the current point. 
  1423.      This is equivalent to the `arc' function (*note arc::.).
  1424.  
  1425. `c'
  1426.      The circle command is followed by three signed, two byte
  1427.      integers.  The first two indicate the x and y coordinates of
  1428.      the center of the circle and the third indicates the radius of
  1429.      the circle.  The center becomes the the current point.  This is
  1430.      equivalent to the `circle' function (*note circle::.).
  1431.  
  1432. `C'
  1433.      The color command is followed by three unsigned, two byte
  1434.      integer which indicate the intensity of RED, GREEN and BLUE
  1435.      components respectively of the background color.  For each
  1436.      component the range of intensity is from 0 to 65535.  A value
  1437.      of (0, 0, 0) represents black and (65535, 65535, 65535)
  1438.      represents white. This is equivalent to the `color' function
  1439.      (*note color::.).
  1440.  
  1441. `e'
  1442.      The erase command is followed by no data.  The erase command is
  1443.      not needed since in `idraw' and PostScript we start off with a
  1444.      blank page.  For this reason the erase command does not
  1445.      actually output any PostScript. This is equivalent to the
  1446.      `erase' function (*note erase::.).
  1447.  
  1448. `f'
  1449.      The linemod command is followed by a newline terminated string
  1450.      containing the name of the line mode (or style) for all
  1451.      subsequent lines, circles and arcs. This is equivalent to the
  1452.      `linemod' function (*note linemod::.) which describes the line
  1453.      styles and their names.
  1454.  
  1455. `F'
  1456.      The the fontname command is followed by a newline terminated
  1457.      string containing the name of the font to be used for all
  1458.      subsequent text. This is equivalent to the `fontname' function
  1459.      (*note fontname::.).
  1460.  
  1461. `l'
  1462.      The line command is followed by two pair of signed, two byte
  1463.      integers which indicate the starting and ending points of the
  1464.      line.  The second pair becomes the the current point. This is
  1465.      equivalent to the `line' function (*note line::.).
  1466.  
  1467. `L'
  1468.      The fill command is followed by an unsigned, two byte integer
  1469.      indicating the intensity of the fill for closed paths.  A value
  1470.      of 1 represents black and a value of 0xFFFF indicates white. 
  1471.      The value 0 is special in that is indicates that no solid fill
  1472.      should occur, and that the interior of the respective path is
  1473.      transparent. This is equivalent to the `fill' function (*note
  1474.      fill::.).
  1475.  
  1476. `m'
  1477.      The move command is followed by a pair of signed, two byte
  1478.      integers containing the location of the new current point.  No
  1479.      line is drawn to this point as opposed to the continue command
  1480.      (`c') which draws a line.  This is equivalent to the `move'
  1481.      function (*note move::.).
  1482.  
  1483. `n'
  1484.      The continue command is followed by pair of signed, two byte
  1485.      integers containing the coordinates of the endpoint of a line
  1486.      segment.  A line is drawn from the previous current point if it
  1487.      was set using a command such as move or continue.  This then
  1488.      becomes the the current point. This is equivalent to the `cont'
  1489.      function (*note cont::.).
  1490.  
  1491. `p'
  1492.      The point command is followed by pair of signed, two byte
  1493.      integers containing the location of single point to be drawn. 
  1494.      This then becomes the the current point. This is equivalent to
  1495.      the `point' function (*note point::.).
  1496.  
  1497. `r'
  1498.      The rotate command is followed by one signed, two byte integer. 
  1499.      It indicates the rotation of all subsequent text.  The rotation
  1500.      is in degrees counter-clockwise from the x (horizontal) axis.
  1501.      This is equivalent to the `rotate' function (*note rotate::.).
  1502.  
  1503. `s'
  1504.      The space command is followed by two pair of signed, two byte
  1505.      integers which indicate the the lower right-hand and upper
  1506.      left-hand corners of the range of plot coordinate space. 
  1507.      `plot2ps' uses the third signed, two byte integer (the
  1508.      right-hand limit) to try to determine the byte order. This is
  1509.      equivalent to the `space' function (*note space::.) which
  1510.      describes the recognized sizes.
  1511.  
  1512. `S'
  1513.      The fontsize command is followed by an signed, two byte integer
  1514.      containing the size in printers points of all subsequent text.
  1515.      This is equivalent to the `fontsize' function (*note
  1516.      fontsize::.).
  1517.  
  1518. `t'
  1519.      The label command is followed by a newline terminated string
  1520.      contains a label which is printed at the current point.  It is
  1521.      left justified and centered vertically with respect to the
  1522.      current point.  The current point is then set at the end of the
  1523.      text. This is equivalent to the `label' function (*note
  1524.      label::.).
  1525.  
  1526. `T'
  1527.      The adjusted label command is followed by two characters which
  1528.      indicate the horizontal and vertical justification respectively
  1529.      and a newline terminated string containing the label.  The
  1530.      label is drawn with the specified justification and the current
  1531.      point is set at the end of the text.  This is equivalent to the
  1532.      `alabel' function (*note alabel::.) which describes how to
  1533.      specify justification.
  1534.  
  1535. 
  1536. File: graphics.info,  Node: Acknowledgements,  Next: Function Index,  Prev: files,  Up: Top
  1537.  
  1538. Acknowledgements
  1539. ================
  1540.  
  1541.    Rich Murphey <Rich@Rice.edu> wrote the first version of the graph,
  1542. plot2tek, plot2ps and tek2plot and the documentation.  Richard
  1543. Stallman <Rms@ai.mit.edu> further directed development of the
  1544. programs and editorial support for the documentation.  John
  1545. Interrante generously provided the PostScript prologue and helpful
  1546. comments on the program.
  1547.  
  1548.    Arthur Smith (Lassp, Cornell University)
  1549. <arthur@helios.tn.cornell.edu> has generously provided his code for
  1550. the xplot utility.
  1551.  
  1552.    Ray Toy <toy@dino.ecse.rpi.edu> provided code for graph and tek
  1553. 4011 and rewrote the tick mark spacing code, incorporated gnu getopt
  1554. and provided the statistics package.
  1555.  
  1556.    David B. Rosen <rosen@bu.edu>, jeffrey templon
  1557. <templon@copper.ucs.indiana.edu> and David W. Forslund
  1558. <dwf%hope.ACL@lanl.gov> tested alpha versions.
  1559.  
  1560. 
  1561. File: graphics.info,  Node: Function Index,  Prev: Acknowledgements,  Up: Top
  1562.  
  1563. Function Index
  1564. ==============
  1565.  
  1566. * Menu:
  1567.  
  1568. * alabel (char X_JUSTIFY, char Y_JUSTIFY, char *LABEL): alabel.
  1569. * arc (int X, int Y, int X0, int Y0, int X1, int Y1): arc.
  1570. * circle (int X, int Y, int R):         circle.
  1571. * closepl ():                           closepl.
  1572. * color (int RED, int GREEN, int BLUE): color.
  1573. * cont (int X, int Y):                  cont.
  1574. * erase():                              erase.
  1575. * fill (int LEVEL):                     fill.
  1576. * fontname (char *FONT_NAME):           fontname.
  1577. * fontsize (int SIZE):                  fontsize.
  1578. * label (char *S):                      label.
  1579. * linemod (char *S):                    linemod.
  1580. * line (int X1, int y1, int X2, int Y2): line.
  1581. * move (int X, int Y):                  move.
  1582. * openpl():                             openpl.
  1583. * point (int X, int Y):                 point.
  1584. * rotate (int W, int H, int ANGLE):     rotate.
  1585. * space (int X0, int Y0, int X1, int Y1): space.
  1586.  
  1587.  
  1588. 
  1589. Tag Table:
  1590. Node: Top185
  1591. Node: introduction1405
  1592. Node: graph examples3456
  1593. Node: Invocation4023
  1594. Node: Input Files5738
  1595. Node: Overlaying7374
  1596. Node: Multiple Plots9252
  1597. Node: Binary Data10199
  1598. Node: graph invocation11308
  1599. Node: plot2ps examples18438
  1600. Node: plot2ps invocation18976
  1601. Node: xplot24218
  1602. Node: xplot invocation24884
  1603. Node: Plot2fig Examples26642
  1604. Node: plot2fig invocation27461
  1605. Node: plot2tek invocation29712
  1606. Node: latex example32425
  1607. Node: psfig33404
  1608. Node: atend.pl35425
  1609. Node: dvips36233
  1610. Node: idraw36641
  1611. Node: ghostscript37002
  1612. Node: libps37591
  1613. Node: alabel38845
  1614. Node: arc39664
  1615. Node: circle39996
  1616. Node: closepl40273
  1617. Node: color40504
  1618. Node: cont41024
  1619. Node: erase41360
  1620. Node: fill41650
  1621. Node: fontname42057
  1622. Node: fontsize42720
  1623. Node: label42977
  1624. Node: line43339
  1625. Node: linemod43698
  1626. Node: move44391
  1627. Node: openpl44765
  1628. Node: point45411
  1629. Node: rotate45677
  1630. Node: space45969
  1631. Node: files46623
  1632. Node: Acknowledgements52811
  1633. Node: Function Index53748
  1634. 
  1635. End Tag Table
  1636.